Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@lumino/coreutils

Package Overview
Dependencies
Maintainers
6
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lumino/coreutils

Lumino Core Utilities


Version published
Weekly downloads
127K
increased by13.92%
Maintainers
6
Weekly downloads
 
Created

What is @lumino/coreutils?

@lumino/coreutils is a utility library that provides a collection of core utilities for JavaScript applications. It includes functions for handling data structures, managing signals, and working with JSON data, among other things.

What are @lumino/coreutils's main functionalities?

Data Structures

The ArrayExt module provides utility functions for working with arrays. In this example, the findFirstIndex function is used to find the first index in the array where the value is greater than 3.

const { ArrayExt } = require('@lumino/coreutils');

let data = [1, 2, 3, 4, 5];
let index = ArrayExt.findFirstIndex(data, value => value > 3);
console.log(index); // Output: 3

JSON Utilities

The JSONExt module provides utility functions for working with JSON data. In this example, the deepEqual function is used to compare two JSON objects for deep equality.

const { JSONExt } = require('@lumino/coreutils');

let obj1 = { a: 1, b: 2 };
let obj2 = { a: 1, b: 2 };
let isEqual = JSONExt.deepEqual(obj1, obj2);
console.log(isEqual); // Output: true

Signal Management

The Signal module provides a way to manage signals and slots, similar to the observer pattern. In this example, a signal is created and connected to a slot that logs the received signal.

const { Signal } = require('@lumino/coreutils');

class MyObject {
  constructor() {
    this._signal = new Signal(this);
  }
  get signal() {
    return this._signal;
  }
}

let obj = new MyObject();
obj.signal.connect((sender, args) => {
  console.log('Signal received:', args);
});
obj.signal.emit('Hello, world!'); // Output: Signal received: Hello, world!

Other packages similar to @lumino/coreutils

FAQs

Package last updated on 08 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc